2. Commands

This is an index of the commands. (One can form a two-byte command by prefixing an instruction with a tilde (~).)

  • \b (hex 08) - prevents auto output.
  • \t (hex 09) - takes two arguments x, y; if x is defined, return x; otherwise, return y.
  • \x0B (hex 0B) - transpiles to ....
  • \x10 (hex 10) - joins string by nothing.
  • \x11 (hex 11) - returns:
  • array: array.join("").split("").
  • string: string.split("").join(""). (Perhaps useless).
  • number: the number sorted.
  • \f (hex 12) - returns the min of two arguments.
  • \r (hex 13) - returns the max of two arguments.
  • - takes the next character C and another argument A and executes A[C] as a function.
  • ! - math.js extension.
  • " - begins string literal; writes characters to compiled code (surrounded by quotes) until another unescaped " is met. If a ' is met, close the previous string and begin a new string. % acts as string interpolation, as such: "Hello, %!"5 => "Hello, 5!"
  • # - converts a to hexadecimal.
  • $ - begin function literal; writes characters to compiled code as is, until another unescaped $ is met
  • % - takes arguments a and b, and
  • string, character - removes all instances of b from a.
  • array, anything - removes all instances of b from a.
  • number, number - a % b.
  • & - takes the boolean conjunction of two arguments (a && b).
  • ' - captures next character as a string.
  • ( - ( terminates the program and kills your computer”
  • ) - transpiles to ){ (closes control structure).
  • * - multiplies 2 arguments
  • number, number - multiplies the two numbers
  • string, number (&) - repeats string number times
  • array, number - creates a 2D array of length number that contains array as all of its members
  • + - adds 2 arguments, according to their types:
  • number, number - adds the two numbers
  • anything, string or string, anything - returns string concatted with anything (preserving order)
  • array, array - concats the two arrays
  • non array, array - Puts non array at the beginning of array
  • array, non array - pushes non array to array
  • set, set - the set union of the two sets
  • , - misc. object:
  • ,a - draws a box, given width, height, and options, in a string, abcd, where a is the corner, b is the horizontal strut, c is the vertical strut, and d is the fill character.
  • ,b - given an array, returns an array [min,Q1,med,Q3,max].
  • ,B - draws a box plot, given an array with ,b.
  • ,d - gives the bounding box of the string a.
  • ,r - performs rot13 on string a.
  • ,R - performs reverse rot13 on string a.
  • ,s - performs rotN on string a.
  • ,S - performs reverse rotN on string a.
  • - - subtracts 2 arguments, according to their types:
  • number, number - subtraction.
  • string, array - removes all objects in array from string.
  • string, non-array - converts the latter to a string and replaces all isntances of it in string with nothing, i.e. deletion.
  • array, anything - filters all instances of anything out of array.
  • number, number - subtraction
  • . - takes 2 arguments O and p and returns O[p]; if O[p] is undefined, returns window[O][p]; if that is undefined, returns 42.
  • / - takes 2 arguments A and B:
  • string, anything - deletes anything in string.
  • array, array - set difference.
  • array, number - I really have no idea what I wrote.
  • number, number - division
  • digits 0-9 - that number.
  • : - begin character literal; writes the next character to compiled code as is. (NOTE: WILL BE CHANGED!!)
  • ; - increases arity of current function by one.
  • < - takes 2 arguments A and B and returns A < B (JS behaviour).
  • = - takes 2 arguments A and B and returns A == B.
  • > - takes 2 arguments A and B and returns A > B (JS behaviour).
  • ? - ternary if, consumes 3 arguments c, a, and b. Roughly equivalent to c?a:b. (Warning: evaluates a and b. Be wary with use in recursive functions. To be fixed, soon.)
  • @ - returns the character code of the next character in the source code.
  • A - takes 3 arguments r, s, and t; replaces each character in s found in r with the respective character found in t.
  • B - takes 1 argument N and converts it to binary as a string (equiv. (N).toString(2)).
  • C - takes 2 arguments A and B and parses the string A as an integer in base B (equiv. parseInt(A,B)).
  • D - begins a function declaration, beginning with function(H,S,n){.
  • E - the empty string ""; is a variable.
  • F - returns the "first" property of 1 argument. Literally equivalent to a[0].
  • G - split's a by b.
  • H - variable used in functions. Undefined to begin with.
  • I - takes input from input box, interpeted as a string.
  • J - takes input from input box, interpeted as a number.
  • K - comma-seperated array input.
  • L - RegExp expansion:
  • (to be explained)
  • M - increases arity of current function by 2
  • N - transiples to return.
  • O - takes the product of 1 argument, depending on its type:
  • array - takes the product of the array.
  • number - takes digit product of the number.
  • P - takes 1 argument A and returns Number(A) (converts all to number, if possible) (conversion an array into a number, as in [1,2,3,1,0,2] => 123102).
  • Q - squares 1 argument S, according to its type:
  • number - multiplies it by itself
  • array - takes the length of the array N and returns an array containing N copies of itself
  • string - appends string with itself (abc => abcabc).
  • R - join's a by b.
  • S - typically an argument to a predicate or function; initialized to a newline.
  • T - takes 2 arguments F and s; surrounds F expression (after compilation) with quotes and evaluates that action F every s milliseconds.=
  • U - takes the square root of the argument.
  • V - takes 1 argument S and is the value V of S; if S is a number, returns S's parity.
  • W - While loop. Potentially buggy when nested.
  • X - JS eval something from input.
  • Y - the empty array []; is a variable.
  • Z - array expansion:
  • (tba)
  • [ - begins array literal, with entries seperated by commas
  • \ - skips a character, sometimes.
  • ] - ends array literal.
  • ^ - takes 2 arguments A and B and retursn A^B (exponentiation) (behaviour TBA)
  • _ - negates 1 argument, according to its type:
  • string or array or set - reverses the entity
  • number - negates the entity
  • ` - forces an argument check
  • a - outputs (alerts/writes) 1 argument
  • b - takes an integer N and a base b and returns (N).toString(b); when b = 1, this is equal to a string of length N filled with #s (TBR).
  • c - parses a as an integer in base b.
  • d - a predicate; roughly analogous to (H,S,n)=>....
  • e - takes 1 argument S and evaluates it as a new Jolf program.
  • f - date expansion:
  • er
  • g - returns the "last" property of 1 argument. Literally equivalent to a[a.length-1].
  • h - heads argument a. (a+1)
  • i - takes input from input box, interpeted as a string.
  • j - takes input from input box, interpeted as a number.
  • k - comma-seperated array input.
  • l - length of a.
  • m - math expansion:
  • (tba)
  • n - variable, often used in predicates and functions; initialized to 0.
  • o - takes next character and literally adds to the source code char=. Used for setting values.
  • p - takes 3 arguments a, b, and s and creates a range [a,b) with a step s.
  • q - the programs source code. (Buggy with " and newlines.)
  • r - takes 2 arguments a and b and creates a range [a,b) (inclusive of a and exclusive of b)
  • s - r, but with inclusive bounds.
  • t - value of ten. Non-writable.
  • u - takes 1 argument
  • array or set - returns the sum of the entity
  • string - behaviour TBA
  • number - takes the digit sum of the number (e.g. u(140) = 1 + 4 + 0 = 5)
  • v - takes 2 arguments S and V; sets the value of variable S to V and creates S if nonexistant (returns V)
  • w - decrements following argument. (a-1)
  • x - JS eval something from input.
  • y - canvas expansion:
  • (wait)
  • z - takes 1 argument and returns a range [1,a].
  • { - begins golfy array. Closed by # (!)
  • | - ORs two arguments.
  • } - closes while (literally, {).
  • ] - slice
  • ~ - more misc expansion:
  • ~# - transpiles to () (to be deprecated).
  • ~0 - Infinity (literally 0/1)
  • ~1 - 100.
  • ~2 - 1000.
  • ~3 - 10000.
  • ~4 - 100000.
  • ~5 - 16.
  • ~L - levenshtein distance between two strings.
  • ~N - writes Number to the compiled code (to be deprecated).
  • ~S - writes String to the compiled code (to be deprecated).
  • ~T - gets the hexadecimal of the charcode of the argument's first char.
  • ~P - ϕ, (1+sqrt[5])/2.
  • ~a - writes Array to the compiled code (to be deprecated).
  • ~e - Euler's number approx 2.718281828459045.
  • ~i - takes 1 argument and returns that argument (the identity function).
  • ~l - creates a new Levensthein object.
  • ~o - writes prototype to the compiled code (to be deprecated).
  • ~p - π approx 3.141592.
  • ~s - writes Set to the compiled code (to be deprecated).
  • ~w - writes window to the compiled code (to be deprecated).
  • ~! - boolean negation.
  • \x7F (hex 7F) - boolean negation.
  • ς - clears the output (lowercase ending sigma).
  • θ - increases the arity of the current function by three.
  • η - decreases the arity of the current function by one.
  • Ʀ - does something.
  • λ - takes the next "function" and uses it as an argument.
  • , , , ,, , , and all do stuff too.
  • ν - is null (lowercase nu).
  • Χ - pops one value off of a (uppercase Chi).
  • χ - shifts one value off of a (lowercase chi).
  • Α - checks if a is not a valid Jolf command (uppercase Alpha).
  • φ - d, but with two arguments. (lowercase phi).
  • Ψ - literally (H,S,n)=>. (uppercase Psi).
  • Ω - "super quote"; Ω+34 would be the string whatever +34 transpiles to (not necessarily what you see in the code preview).
  • Ρ - equiv. a.replace(/b/,c) i.e. single replace. (uppercase Rho).
  • ρ - equiv. a.replace(/b/g,c) i.e. global replcae. (lowercase rho).
  • μ - unique-ify input. (lowercase mu).
  • σ - sigma_k(n) function. (lowercase simga).
  • ε - JS eval (lowercase epsilon).
  • ι - provides the index of the token (hardcoded into the resulting code)
  • β - lambda generator
  • © - lambda math
  • ΅ - lambda string
  • Ξ - decompressions entity
  • \x82 - binary manhattan addition (e.g. 1 +m 5 = 15)
  • \x83 - ternary manhattan addition (e.g. 3 +m 5 +m 2 = 352)
  • Τ - ternary multiplication
  • Ά - ternary addition
  • ΄ - ternary subtraction
  • Ο - ternary division